<?php
	if ($_POST['Send']) {
		$Date = Journee::GetDate($IDJournee);
		$Club_ID_Club_Dom = $_POST["Club_ID_Club_Dom"];
		$Club_ID_Club_Vis = $_POST["Club_ID_Club_Vis"];
		for ($i=0;$i<$NBRencontres;$i++) {
			$Rencontre = New Rencontre (null,$Club_ID_Club_Dom[$i],$Club_ID_Club_Vis[$i],$IDJournee,$Date,null,null);
			$Rencontre->Ajout();
		}
	}
	else {
		$Clubs = Club::GetList($IDChamp, "Lib_Club ASC");

		$form = new Formulaire("POST",root()."Admin/index.php?Module=".$Module."&amp;Action=AjouterRencontres&amp;IDChamp=".$IDChamp."&amp;IDJournee=".$IDJournee."&amp;NBRencontres=".$NBRencontres);
		$form->champCache("Send",true);
		$form->debutTable(Formulaire::HORIZONTAL,array(),$NBRencontres);
		$form->champListe("Equipe 1","Club_ID_Club_Dom[]",1,1,$Clubs );
		$form->champListe("Equipe 2","Club_ID_Club_Vis[]",1,1,$Clubs);
		$form->finTable();
		$form->champValider("Valider","valider");
		echo $form->formulaireHTML();
	}
?>